package com.iotechn.unimall.data.dto.excel;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import lombok.Data;

import java.io.Serializable;
import java.text.DecimalFormat;
import java.util.Date;

/**
 * @author kyms
 * @date 2020-07-27 09:50
 */
@ExcelTarget("DistributionBalanceDetailDTO")
@Data
public class DistributionBalanceDetailDTO implements Serializable {

    private Long userId;
    @Excel(name = "描述", width = 30)
    private String description;

    @Excel(name = "时间", format = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;

    @Excel(name = "余额(元)")
    private Float balance;

    private  Long distributionId;

    public Float getBalance() {
        if (this.balance == null) {
            return 0F;
        }
        DecimalFormat decimalFormat = new DecimalFormat(".00");
        String total = decimalFormat.format((this.balance / 100));
        return Float.valueOf(total);

    }
}
